<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .div{
            width: 1000px;
            /* height: 450px; */
            margin: 0 auto;
            background-color: pink;
            /* 清除浮动2 */
            /* overflow: hidden; */
        }
        .div::after{
            /* 清除浮动3 */
            content: "";
            display: block;
            height: 0;
            clear: both;
            visibility: hidden;
        }
        .div2{
            width: 1000px;
            height: 450px;
            margin: 0 auto;
            background-color: pink;
        }
        .l{
            width: 300px;
            height: 450px;
            background-color: red;
            float: left;
        }
        .r{
            width: 700px;
            height: 450px;
            background-color: burlywood;
            float: left;
            
        }
        ul{
            margin: 0;
            padding: 0;
            list-style-type: none; /* 去除圆点 */
        }
        li{
            width: 242px;
            height: 450px;
            background-color: #554c4c;
            float: left;
            margin-right: 10px;
        }
        .div2 #last{
            margin-right: 0;
        }
        .clear{
            /* 清除浮动1 */
            clear: both;
        }
    </style>
</head>
<body>
    <div class="div">
        <div class="l">左</div>
        <div class="r">右</div>
        <!-- 清除浮动1 -->
        <!-- <div class="clear"></div> -->
    </div>
    <div class="div2">
        <ul>
            <li>1</li>
            <li>2</li>
            <li>3</li>
            <li id="last">4</li>
        </ul>
    </div>
</body>
</html>